SC_setupObject
SYNTAX
SC_setupObject objNum , GroupNum , Collision Type
-objNum: the object you want to setup
-groupNum: the group that you want this object to belong to (0 for no group)
-collisionType: sets the type of collision to use with this object
0 - polygon collision, will check with every polygon in the object
1 - sphere collision, will create a sphere around the object to use in collisions
2 - box collision, will create a box around the object for collisions.
This command sets up an object for ray casting, object collision, and sliding collision, it need
only be called once for each object. This command will NOT work when the object has been scaled before
calling it. To use a scaled object in collision first setup the object then use the SC_allowObjectScaling
command. After this scale the object using normal DarkBasic commands and then use SC_UpdateObject
to update the object.
setupObject can be sucessfully called on an existing object, doing so
will overwrite any stored collision data with the new object's data and reset collision to ON
and scaling to False. The only drawback is re-settingup a complex/polygon object may take time.
Updated from memblocks to use direct vertex access
RELATED INFO
Collision Commands Menu
Index